
		Imports Acceso_a_Datos.Datos
		Namespace BO
		Partial Public Class tCarnet_x_Persona



# Region "tCarnet"

		private mtCarnet As New tCarnet

		Public Property tCarnet As tCarnet
        Get
                mtCarnet = mtCarnet.TraerFiltradoListOf("IdCarnet", Me.IdCarnet).Item(0)
        Return mtCarnet
        End Get
        Set
             If ((mtCarnet Is Nothing) Or (Me.tCarnet.Equals(value) = False)) Then
                If Not (Me.tCarnet Is Nothing)
	               Dim oldtCarnet As tCarnet = Me.tCarnet
                   Me.mtCarnet = Nothing
                   oldtCarnet.RemoveListatCarnet_x_Persona(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtCarnet = value
                   Me.tCarnet.AddListatCarnet_x_Persona(Me)
            	End If
             End If
        End Set
       End Property

# End Region



# Region "tMunicipios"

		private mtMunicipios As New tMunicipios

		Public Property tMunicipios As tMunicipios
        Get
                mtMunicipios = mtMunicipios.TraerFiltradoListOf("IdMunicipio", Me.IdMunicipio).Item(0)
        Return mtMunicipios
        End Get
        Set
             If ((mtMunicipios Is Nothing) Or (Me.tMunicipios.Equals(value) = False)) Then
                If Not (Me.tMunicipios Is Nothing)
	               Dim oldtMunicipios As tMunicipios = Me.tMunicipios
                   Me.mtMunicipios = Nothing
                   oldtMunicipios.RemoveListatCarnet_x_Persona(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtMunicipios = value
                   Me.tMunicipios.AddListatCarnet_x_Persona(Me)
            	End If
             End If
        End Set
       End Property

# End Region



# Region "tPersonas"

		private mtPersonas As New tPersonas

		Public Property tPersonas As tPersonas
        Get
                mtPersonas = mtPersonas.TraerFiltradoListOf("IdPersona", Me.IdPersona).Item(0)
        Return mtPersonas
        End Get
        Set
             If ((mtPersonas Is Nothing) Or (Me.tPersonas.Equals(value) = False)) Then
                If Not (Me.tPersonas Is Nothing)
	               Dim oldtPersonas As tPersonas = Me.tPersonas
                   Me.mtPersonas = Nothing
                   oldtPersonas.RemoveListatCarnet_x_Persona(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtPersonas = value
                   Me.tPersonas.AddListatCarnet_x_Persona(Me)
            	End If
             End If
        End Set
       End Property

# End Region


# Region "Lecturas que devuelven listas"
Public Function TraerTodosListOf() As List(Of tCarnet_x_Persona)
            Dim dtDatos As DataTable
            Dim listatCarnet_x_Persona As New List(Of tCarnet_x_Persona)
            Dim param As [String]
            param = (Me.mNombreEntidad + "_SelectAll")
            dtDatos = Me.ServidorDatos.TraerDataTable(param)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet_x_Persona As New tCarnet_x_Persona
				mtCarnet_x_Persona.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtCarnet_x_Persona.Traer_objeto()
            	listatCarnet_x_Persona.Add( mtCarnet_x_Persona)
    		Next dr
Return listatCarnet_x_Persona
End Function

Public Function TraerFiltradoListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tCarnet_x_Persona)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatCarnet_x_Persona As New List(Of tCarnet_x_Persona)
            param = (Me.mNombreEntidad + "_Tx")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet_x_Persona As New tCarnet_x_Persona
				mtCarnet_x_Persona.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtCarnet_x_Persona.Traer_objeto()
            	listatCarnet_x_Persona.Add( mtCarnet_x_Persona)
    		Next dr
Return listatCarnet_x_Persona
End Function

Public Function TraerFiltradoLikeListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tCarnet_x_Persona)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatCarnet_x_Persona As New List(Of tCarnet_x_Persona)
            param = (Me.mNombreEntidad + "_TxLike")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet_x_Persona As New tCarnet_x_Persona
				mtCarnet_x_Persona.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtCarnet_x_Persona.Traer_objeto()
            	listatCarnet_x_Persona.Add( mtCarnet_x_Persona)
    		Next dr
Return listatCarnet_x_Persona
End Function
# End Region

End Class
End Namespace
